#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
	int arr[50] = { 0 };
	int n = 0;
	int find = 0;
	scanf("%d", &n);

	for (int i = 0; i < n; i++)
	{
		scanf("%d", &arr[i]);
	}
	scanf("%d", &find);

	for (int i = 0; i < n; i++)
	{
		if (find == arr[i])
		{
			arr[i] = 0;
		}

	}

	for (int i = 0; i < n; i++)
	{
		if (arr[i] != 0)
		{
			printf("%d ", arr[i]);

		}
	}
	return 0;
}